package com.vogtec.fota.config;

import com.vogtec.fota.quartz.FinishJob;
import com.vogtec.fota.quartz.StartJob;
import lombok.Data;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by wei on 2017/7/3.
 */
@Configuration
@Data
public class Config {

//    @Bean
//    public ObjectMapper objectMapper(){
//        return new ObjectMapper();
//    }

//    @Value("${picture.host}")
//    private String pictureHost;

    @Bean(name = "jobDetail")
//    @Scope("prototype")
    public JobDetail jobDetail(){return new JobDetail("startJob", Scheduler.DEFAULT_GROUP,StartJob.class);}

    @Bean(name = "jobDetail1")
//    @Scope("prototype")
    public JobDetail jobDetail1(){return new JobDetail("endJob", Scheduler.DEFAULT_GROUP,FinishJob.class);}

    @Value("${server.address}")
    private String address;

    @Value("${server.port}")
    private String port;

    public static Integer taskId = null;
}